//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#include "CCompDLL.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
__fastcall CComptesDLL::CComptesDLL()
{
  m_pfncOpenTables       = NULL;
  m_pfncCloseTables      = NULL;
  m_pfncGetCompte        = NULL;
  m_pfncInitEnsembles    = NULL;
  m_pfncParamComptes     = NULL;
  m_pfncMigrerComptesTmp = NULL;

  m_hinstComptes         = ::LoadLibrary( "comptes.dll");
  m_pfncOpenTables       = ( CPTOpenTables   )   ::GetProcAddress( m_hinstComptes, "COMPTESOpenTables");                                 ASSERT( m_pfncOpenTables);
  m_pfncCloseTables      = ( CPTCloseTables  )   ::GetProcAddress( m_hinstComptes, "COMPTESCloseTables");                                ASSERT( m_pfncCloseTables);
  m_pfncGetCompte        = ( CPTGetCompte    )   ::GetProcAddress( m_hinstComptes, "@COMPTESGetCompte$qqrii");                           ASSERT( m_pfncGetCompte);
  m_pfncInitEnsembles    = ( CPTInitEnsembles)   ::GetProcAddress( m_hinstComptes, "@COMPTESInitEnsembles$qqrp6CBarreipv");              ASSERT( m_pfncInitEnsembles);
  m_pfncParamComptes     = ( CPTParamComptes )   ::GetProcAddress( m_hinstComptes, "COMPTESParamComptes");                               ASSERT( m_pfncParamComptes);
  m_pfncMigrerComptesTmp = ( CPTMigrerComptesTmp)::GetProcAddress( m_hinstComptes, "@COMPTESMigrerComptesTmp$qqrrx17System@AnsiString"); ASSERT( m_pfncMigrerComptesTmp);
}
//---------------------------------------------------------------------------
__fastcall CComptesDLL::~CComptesDLL()
{
  ::FreeLibrary( m_hinstComptes);
}
//---------------------------------------------------------------------------
void __cdecl CComptesDLL::InitEnsembles( CBarre *pBarre, int nNbEnsembles, ...)
{
  va_list lstEnsembles;
  va_start( lstEnsembles, nNbEnsembles);
  m_pfncInitEnsembles( pBarre, nNbEnsembles, lstEnsembles);
  va_end( lstEnsembles);
}
//---------------------------------------------------------------------------
